-- @owner: opentestcase027
-- @date: 2022/6/9
-- @testpoint: ceil函数结合distinct的使用

--step1:建表 expect:建表成功
drop table if exists t_ustore_ceil_0023;
create table t_ustore_ceil_0023(
col_1 decimal,
col_2 int ,
col_3 float8,
col_4 decimal(6,2)
) with (storage_type=ustore);
 
--step2:创建序列 expect:序列创建成功
drop sequence if exists seq_ustore_ceil_0023;
create sequence seq_ustore_ceil_0023 increment by 1 start with 100000;
 
--step3:循环插入1000条数据 expect:插入成功
begin
 for i in 1..1000 loop
      insert into t_ustore_ceil_0023 values(
   3.1415926+seq_ustore_ceil_0023.nextval,
   i,
   1.0e+100,
   i+445.255
   );
    end loop;
end;
/

--step4:ceil函数结合distinct使用 expect:查询结果 1e+100
select distinct ceil(col_3) t1 from t_ustore_ceil_0023 order by t1 limit 10;

--step5:清理环境 expect:清理成功
drop table if exists t_ustore_ceil_0023;
drop sequence if exists seq_ustore_ceil_0023;